var React = require('react')
var TypeNew = React.createClass({
    hanlderKeyUp (e) {
        if (e.keyCode === 13) {
            let value = e.target.value
            if (!value) return false
            let arry = this.props.todoList
            arry.push({
                value: value,
                isCheck: false
            })
            this.props.addItem(arry)
            e.target.value = ''
        }
    },
    render () {
        return (
            <div>
                <input type="text" placeholder="请输入添加的内容" onKeyUp={this.hanlderKeyUp}/>
            </div>
        )
    }
})
module.exports = TypeNew